#include <stdio.h>
#include <string.h> 

int getparameter(char *key,char *value){
    FILE* file = fopen("config/config.ini","r");
    while(1){
        char line[100];
        memset(line,0,sizeof(line));
        char *res = fgets(line,sizeof(line),file);
        if(res == NULL){
            char buf[] = "没有要找到内容\n";
            memcpy(value,buf,strlen(buf));
            return -1;
        }
        char *line_key = strtok(line,"=");
        if(strcmp(key,line_key)==0){
            char* line_value = strtok(NULL,"=");
            memcpy(value,line_value,strlen(line_value));
            fclose(file);
            return 0;
        }
    }
    return 0;
}
